# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ToolResults.V1beta3.Model.GraphicsStats do
  @moduledoc """
  Graphics statistics for the App. The information is collected from 'adb shell dumpsys graphicsstats'. For more info see: https://developer.android.com/training/testing/performance.html Statistics will only be present for API 23+.

  ## Attributes

  *   `buckets` (*type:* `list(GoogleApi.ToolResults.V1beta3.Model.GraphicsStatsBucket.t)`, *default:* `nil`) - Histogram of frame render times. There should be 154 buckets ranging from [5ms, 6ms) to [4950ms, infinity)
  *   `highInputLatencyCount` (*type:* `String.t`, *default:* `nil`) - Total "high input latency" events.
  *   `jankyFrames` (*type:* `String.t`, *default:* `nil`) - Total frames with slow render time. Should be <= total_frames.
  *   `missedVsyncCount` (*type:* `String.t`, *default:* `nil`) - Total "missed vsync" events.
  *   `p50Millis` (*type:* `String.t`, *default:* `nil`) - 50th percentile frame render time in milliseconds.
  *   `p90Millis` (*type:* `String.t`, *default:* `nil`) - 90th percentile frame render time in milliseconds.
  *   `p95Millis` (*type:* `String.t`, *default:* `nil`) - 95th percentile frame render time in milliseconds.
  *   `p99Millis` (*type:* `String.t`, *default:* `nil`) - 99th percentile frame render time in milliseconds.
  *   `slowBitmapUploadCount` (*type:* `String.t`, *default:* `nil`) - Total "slow bitmap upload" events.
  *   `slowDrawCount` (*type:* `String.t`, *default:* `nil`) - Total "slow draw" events.
  *   `slowUiThreadCount` (*type:* `String.t`, *default:* `nil`) - Total "slow UI thread" events.
  *   `totalFrames` (*type:* `String.t`, *default:* `nil`) - Total frames rendered by package.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :buckets => list(GoogleApi.ToolResults.V1beta3.Model.GraphicsStatsBucket.t()) | nil,
          :highInputLatencyCount => String.t() | nil,
          :jankyFrames => String.t() | nil,
          :missedVsyncCount => String.t() | nil,
          :p50Millis => String.t() | nil,
          :p90Millis => String.t() | nil,
          :p95Millis => String.t() | nil,
          :p99Millis => String.t() | nil,
          :slowBitmapUploadCount => String.t() | nil,
          :slowDrawCount => String.t() | nil,
          :slowUiThreadCount => String.t() | nil,
          :totalFrames => String.t() | nil
        }

  field(:buckets, as: GoogleApi.ToolResults.V1beta3.Model.GraphicsStatsBucket, type: :list)
  field(:highInputLatencyCount)
  field(:jankyFrames)
  field(:missedVsyncCount)
  field(:p50Millis)
  field(:p90Millis)
  field(:p95Millis)
  field(:p99Millis)
  field(:slowBitmapUploadCount)
  field(:slowDrawCount)
  field(:slowUiThreadCount)
  field(:totalFrames)
end

defimpl Poison.Decoder, for: GoogleApi.ToolResults.V1beta3.Model.GraphicsStats do
  def decode(value, options) do
    GoogleApi.ToolResults.V1beta3.Model.GraphicsStats.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ToolResults.V1beta3.Model.GraphicsStats do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
